import service from "@/server/serviceIndex";
// 获取实体店商品
export const getOrderListByShopIdAPI = (data) => {
  return service({
    method: "post",
    url: '/pipayshopapi/store-order/getOrderList',
    data: data
  });
};
// 获取酒店商品
export const getLiveOrderListByShopIdAPI = (data) => {
  return service({
    method: "post",
    url: '/pipayshopapi/shop-order/getOrderList',
    data: data
  });
};
//实体店根据商品名查找订单接口
export const getOrderListByShopNameAPI = (data) => {
  return service({
    method: "post",
    url: '/pipayshopapi/store-order/getOrderListByShopName',
    data: data
  });
};

// 酒店根据商品名查找订单接口
export const getLiveOrderListByShopNameAPI = (data) => {
  return service({
    method: "post",
    url: '/pipayshopapi/shop-order/getLiveOrderListByShopName',
    data: data
  });
};
// 获取实体店商品
export const getOrderListAPI = (orderStatus, shopId, pageSize, currentPage) => {
  return service({
    method: "get",
    url: `/pipayshopapi/shop-order/getOrderListByShopId`,
    params: {
      orderStatus,
      shopId,
      pageSize,
      currentPage,
    },
  });
};

// 实体店删除订单接口
export const DelShopOrderAPI = (orderId) => {
  return service({
    method: "post",
    url: `/pipayshopapi/shop-order/delOrder/${orderId}`,
  });
};

// 、、订单超时未支付的失效操作接口
export const failOrderShopAPI = (orderId) => {
  return service({
    method: "post",
    url: `/pipayshopapi/shop-order/failOrder/${orderId}
`,
  });
};

//根据店铺id查询商品列表(审核相关)
export const selectCommodityAPI = (shopId) => {
  return service({
    method: "get",
    url: `/pipayshopapi/shop-commodity-info/selectCommodityByShopIdAndStatus/${shopId}`,
  });
};
//获取实体店的粉丝列表
export const getFollowListAPI = (shopId, pageNum, pageSize) => {
  return service({
    method: "get",
    url: `/pipayshopapi/store-follow-focus/getFollowList/${shopId}/${pageNum}/${pageSize}`,
  });
};
//获取实体店商品列表
export const getOrderListByShopId = (
  orderStatus,
  shopId,
  pageSize,
  currentPage
) => {
  return service({
    method: "get",
    url: `/pipayshopapi/shop-order/getOrderListByShopId`,
    data: {
      orderStatus,
      shopId,
      pageSize,
      currentPage,
    },
  });
};
// 删除订单接口
export const delOrderAPI = (orderId) => {
  return service({
    method: "post",
    url: `/pipayshopapi/shop-order/delOrder/${orderId}`,
  });
};
// 删除订单接口
export const failOrderAPI = (orderId) => {
  return service({
    method: "post",
    url: `/pipayshopapi/shop-order/failOrder/${orderId}`,
  });
};
// 订单已完成接口
export const completedOrderAPI = (orderId) => {
  return service({
    method: "post",
    url: `/pipayshopapi/shop-order/completedOrder/${orderId}`,
  });
};
// 支付下单接口
export const payShopOrderAPI = (token) => {
  return service({
    method: "post",
    url: `/pipayshopapi/store-order/payOrder?token=${token}`,
  });
};
//修改订单价格接口
export const changeShopPriceAPI = (orderId, price) => {
  return service({
    method: "post",
    url: `/pipayshopapi/shop-order/changePrice`,
    data: {
      orderId,
      price,
    },
  });
};
//（买家）用户的全部酒店订单列表分页展示标识id -1：所有订单 0：未支付订单 1：已支付订单 2：已完成（已经收货）订单
export const getOrderLiveListAPI = (
  orderStatus,
  userId,
  pageSize,
  currentPage
) => {
  return service({
    url: `/pipayshopapi/shop-order/getOrderLiveList`,
    params: {
      orderStatus,
      userId,
      pageSize,
      currentPage,
    },
  });
};

//酒店订单（未支付 / 已支付）的详情接口
export const getLiveOrderDetailAPI = (orderId) => {
  return service({
    url: `/pipayshopapi/shop-order/getLiveOrderDetail/${orderId}`,
  });
};
